<template>
	<view style="padding: 40rpx;">
		<view class="sun-title">
			{{formData.title}}
		</view>
		<view class="sun-date">
			{{formData.time_format}}
		</view>
		<view class="sun-content" v-if="formData.details != undefied">
			<!-- <rich-text :nodes="decodeHtmlEntities(formData.details)"></rich-text> -->
			<div v-html="formData.details"></div>

		</view>
	</view>
</template>

<script setup>
	import {
		homeInfo
	} from '@/api/home/home.js'
	import {
		onMounted,
		ref,
		getCurrentInstance
	} from "vue";
	import {
		useI18n
	} from "vue-i18n";
	const {
		t
	} = useI18n()
	let formData = ref({})
	uni.setNavigationBarTitle({
		title: t('user.Details')
	});

	function onLoad(res) {
		console.log(res)
		homeInfo(res).then(data => {
			formData.value = data.data
			console.log(formData.value)
		})
	}
	onMounted(() => {
		// #ifdef APP  
		let res = getCurrentInstance().attrs.__pageInstance.options.id
		// #endif
		// #ifdef H5 
		let res = getCurrentInstance().attrs.id
		// #endif   
		onLoad(res)
	})
</script>

<style>
	.sun-title {
		font-size: 16px;
		font-weight: 700;
		color: rgba(34, 34, 34, 1);
	}

	.sun-date {
		font-size: 10px;
		color: rgba(153, 153, 153, 1);
	}

	.sun-content {
		font-size: 12px;
		color: rgba(102, 102, 102, 1);
	}
</style>